package cn.zhaozhiqi.service.impl;

import cn.zhaozhiqi.pojo.domain.DriverWallet;
import cn.zhaozhiqi.mapper.DriverWalletMapper;
import cn.zhaozhiqi.service.IDriverWalletService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 司机的钱包 服务实现类
 * </p>
 *
 * @author zhaozhiqi
 * @since 2024-12-17
 */
@Service
public class DriverWalletServiceImpl extends ServiceImpl<DriverWalletMapper, DriverWallet> implements IDriverWalletService {

    @Override
    public void create(long driverId) {
        //司机注册后同步进行t_driver_wallet 司机钱包表的保存
        DriverWallet driverWallet = new DriverWallet();
        driverWallet.setId(driverId);
        driverWallet.setAmount(BigDecimal.ZERO);
        driverWallet.setCreateTime(new Date());
        driverWallet.setUpdateTime(new Date());
        super.save(driverWallet);
    }
}
